<div class="blade-static __bottom" ng-if="pageSettings.itemsPerPageCount < pageSettings.totalItems" ng-include="'pagerTemplate.html'"></div>
<div class="blade-content __medium-wide">
  <div class="blade-inner">
    <div class="inner-block">
      <div class="table-wrapper" ng-init="setGridOptions({
                enableSorting: false,
                rowTemplate: 'session-list.row.html',
                rowHeight: 50,
                columnDefs: [
                    { name: 'actions', displayName: '', enableColumnResizing: false, enableSorting: false, width: 30, cellTemplate: 'session-actions.cell.html', pinnedLeft:true },
                    {
                       displayName: 'platform.blades.sessions-list.labels.ip-address',
                       name: 'ipAddress'
                    },
                    {
                       displayName: 'platform.blades.sessions-list.labels.user-agent',
                       name: 'userAgent'
                    }
                    ]})">
        <div ui-grid="gridOptions" ui-grid-auto-resize ui-grid-save-state ui-grid-resize-columns ui-grid-move-columns ui-grid-pinning ui-grid-height></div>
        <ul class="menu __context" role="menu" id="session_menu">
          <li class="menu-item" ng-click='terminate(contextMenuEntity)' va-permission="platform:security:revokeToken">
            <i class="menu-ico fas fa-trash-alt"></i> {{'platform.commands.terminate' | translate}}
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>

<script type="text/ng-template" id="session-list.row.html">
  <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid"
       ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'"
       class="ui-grid-cell"
       ng-class="{'ui-grid-row-header-cell': col.isRowHeader, '__hovered': grid.appScope.contextMenuEntity === row.entity, '__selected': row.entity.id===grid.appScope.selectedNodeName }"
       role="{{col.isRowHeader ? 'rowheader' : 'gridcell' }}"
       ui-grid-cell context-menu="grid.appScope.contextMenuEntity = row.entity"
       data-target="session_menu">
  </div>
</script>

<script type="text/ng-template" id="session-actions.cell.html">
  <div class="ui-grid-actions" left-click-menu="grid.appScope.contextMenuEntity = row.entity" data-target="session_menu">
    <i class="fa fa-ellipsis-v"></i>
  </div>
</script>
